feat: API specs update for version 1.9.x#78
Conversation
Greptile SummaryThis PR updates the Appwrite 1.9.x API specs and code examples with several improvements: adding
Confidence Score: 3/5The spec files contain a widespread default-value type mismatch that will affect SDK code generators consuming these specs. All six spec files set "default":[] on fields explicitly typed as "type":"object" — document data payloads, header maps, and similar. This appears in 40+ locations across the OpenAPI 3 and Swagger 2 variants for server, console, and client. SDK generators that read these defaults will initialize object-typed parameters as arrays instead of empty objects, producing type errors at runtime. The remainder of the changes (x-enum-keys, transactionId query-param migration, Go type fixes, binary response schemas) look correct. All three OpenAPI 3 spec files (server, console, client) need close attention for the default-value issue; the swagger2 server and console specs have fewer but still present occurrences. Important Files Changed
Reviews (1): Last reviewed commit: "chore: update API specs with OpenAPI 3 p..." | Re-trigger Greptile |
| "type": "object", | ||
| "x-example": "{\"Authorization\":\"Bearer token123\",\"X-Custom-Header\":\"value\"}", | ||
| "default": {} | ||
| "default": [], | ||
| "x-example": "{\"Authorization\":\"Bearer token123\",\"X-Custom-Header\":\"value\"}" |
There was a problem hiding this comment.
Object-typed field assigned an array default
Throughout this file (and across open-api3-1.9.x-console.json, open-api3-1.9.x-client.json, and the swagger2 variants), every "type": "object" field that previously had "default": {} has been changed to "default": []. Per JSON Schema, the default value must be valid against the declared schema type; an array literal [] is not a valid default for a schema with "type": "object". SDK code generators and validators that consume these specs will produce type-incorrect defaults — e.g., a headers map or a document data map initialized as an empty array rather than an empty object. This pattern repeats at least 19 times in this file alone (screenshot headers at line 6114, document data at line 18023, function-execution headers at line 21853, and many more), and also appears in the console and client OpenAPI3 specs.
This PR contains API specification updates for version 1.9.x.